<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
$steps=array('选择配置类型','选择户型','产生配置单');
$return['ishome']=array('检索小区户型','自定义户型');
$return['home_types']=$this->home_types;
if($_RQ['op']=='main'){
	if($_RQ['postdata']){
		$post=get_postdata();
		if(!$post['storeid']){
			exi('必须选择门店等','error');
		}
		$_SESSION['postdata']=$post;
		exi('','','/order.add/home/');
	}
	$item=array(
		'type'=>$_SESSION['postdata']['type']?:'0',
		'storeid'=>$_SESSION['postdata']['storeid'],
	);
	$return['item']=$item;
	$htmls=array(
		'type'=>'edit',
		'desc'=>'选择类型',
		'submit_title'=>'保存并下一步',
		'show_last'=>false,
		'edit'=>array(
			array('name'=>'type','title'=>'空调类型','type'=>'radio','options'=>'types'),
			array('name'=>'storeid','title'=>'选择门店','type'=>'select','options'=>'stores'),
		)
	);
	$return['types']=array('中央空调','普通家用空调');
	$return['htmls'][]=array('type'=>'steps','steps'=>$steps,'step'=>'1');
	$return['htmls'][]=$htmls;
	$return['stores']=pdo_getall('jy_weishop_store',array('uniacid'=>$_SESSION['uniacid']),array('id','title'),'id');
	exi($return);
}
if($_RQ['op']=='home'){
	if($_RQ['postdata']){
		$post=get_postdata();
		if(!$post['ishome'] && (!$post['shequid'] || !$post['homeid']|| !$post['peilistid'])){
			exi('必须选择小区，选择户型,选择方案等','error');
		}
		if($post['ishome'] && !count($post['houseinfo']) && !count($post['tinginfo'])){
			exi('请填写房间信息或客厅信息等','error');
		}
		if($post['ishome'] && !$post['groupid']){
			exi('请选择品牌分类','error');
		}
		$post['storeid']=$post['storeid2'];
		unset($post['storeid2']);
		$_SESSION['postdata']=$post;
		exi('','','/order.add/post/');
	}
	$htmls=array(
		'type'=>'edit',
		'desc'=>'选择户型',
		'show_last'=>true,
		'submit_title'=>'保存并下一步',
		'edit'=>array(
			array('name'=>'ishome','title'=>'选择现有户型？','type'=>'radio','options'=>'ishome'),
			array('type'=>'select3_line','show'=>array('ishome'=>0),'name'=>'shequid','options'=>'shequs','title'=>'选择小区','help'=>'[温馨提示]：门店下面的小区，没有户型，需要先添加户型!',
				'name2'=>'homeid','options2'=>'homes','title2'=>'请选择户型',
				'name3'=>'peilistid','options3'=>'peilist','title3'=>'请选择方案',
			),
			array('name'=>'hometypeid','title'=>'建筑类型','type'=>'select','options'=>'hometypes','show'=>array('ishome'=>1)),
			array(
				'type'=>'array',
				'show'=>array('ishome'=>1),
				'name'=>'houseinfo',
				'title'=>'房间信息',
				'add_tip'=>'添加一个房间',
				'list'=>array(
					array('type'=>'string','name'=>'title','title'=>'房间名称','help'=>'比如：主卧，次卧，书房'),
					array('name'=>'mianji','title'=>'房间面积','type'=>'unitstring','unit'=>'m²'),			
				),
				'details'=>array(
					array('type'=>'string','name'=>'title','title'=>'房间名称','help'=>'比如：主卧，次卧，书房'),
					array('name'=>'mianji','title'=>'房间面积','type'=>'unitstring','unit'=>'m²'),	
				)
			),
			array(
				'type'=>'array',
				'show'=>array('ishome'=>1),
				'name'=>'tinginfo',
				'title'=>'客厅信息',
				'add_tip'=>'添加一个客厅',
				'list'=>array(
					array('type'=>'string','name'=>'title','title'=>'客厅名称','help'=>'比如：客厅,餐厅'),
					array('name'=>'mianji','title'=>'客厅面积','type'=>'unitstring','unit'=>'m²'),			
				),
				'details'=>array(
					array('type'=>'string','name'=>'title','title'=>'房间名称','help'=>'比如：客厅,餐厅'),
					array('name'=>'mianji','title'=>'客厅面积','type'=>'unitstring','unit'=>'m²'),	
				)
			),
			array('type'=>'select','name'=>'groupid','options'=>'groups','title'=>'选择品牌分类','show'=>array('ishome'=>1),'help'=>'[温馨提示]：同一批方案，最好选择同一品牌的机子!'),
		)
	);
	$return['htmls'][]=array('type'=>'steps','steps'=>$steps,'step'=>'2');
	$return['htmls'][]=array(
		'type'=>'message',
		'message'=>'温馨提示：带“*”的为必填项！',
	);
	$return['htmls'][]=$htmls;
	$return['groups']=pdo_getall('jy_weishop_goods_group',array('uniacid'=>$_SESSION['uniacid'],'merchid'=>0,'mid'=>0,'parentid'=>0,'onepluginname'=>'jy_kongtiaoshop'),array('title','id'),'id');
	$prams=array('uniacid'=>$_SESSION['uniacid'],'storeid'=>$_SESSION['postdata']['storeid']);
	$return['shequs']=pdo_getall('jy_kongtiaoshop_shequ',$prams,array('title','id'),'id');
	foreach($return['shequs'] as &$pv){
		$shequid=$shequid?:$pv['id'];
		$pv['homes']=pdo_getall('jy_kongtiaoshop_home',array('uniacid'=>$_SESSION['uniacid'],'shequid'=>$pv['id']),array('title','id'),'id');
		foreach($pv['homes'] as &$hv){
			$homeid=$homeid?:$hv['id'];
			$hv['peilist']=pdo_getall('jy_kongtiaoshop_peilist',array('type'=>$_SESSION['postdata']['type'],'homeid'=>$hv['id'],'groupid >'=>0,'uniacid'=>$_SESSION['uniacid']),array('id','title'),'id');
		}
	}
	$item=array(
		'type'=>$_SESSION['postdata']['type'],
		'storeid2'=>$_SESSION['postdata']['storeid'],
		'shequid'=>$shequid,
		'homeid'=>$homeid,
		'ishome'=>$_SESSION['postdata']['ishome']?:'0',
		'hometypeid'=>$_SESSION['postdata']['hometypeid'],
		'tinginfo'=>$_SESSION['postdata']['tinginfo'],
		'houseinfo'=>$_SESSION['postdata']['houseinfo'],
		'peilistid'=>$_SESSION['postdata']['peilistid']?:'0',
		'groupid'=>$_SESSION['postdata']['groupid']?:'0',
	);
	$return['hometypes']=pdo_getall('jy_kongtiaoshop_home_type',array('uniacid'=>$_SESSION['uniacid']),array('id','title'),'id');
	//print_r($item);exit;
	$return['item']=$item;
	exi($return);
}
if($_RQ['op']=='post'){
	if($_RQ['postdata']){
		$post=get_postdata();
		if(!$post['name'] || !$post['mobile'] || !$post['pcd'] ||  !$post['address']){
			exi('必须填写客户姓名，电话，地址等','error');
		}
		$mid=$post['mid'];
		if(!$mid){
			$member=array(
				'nickname'=>trim($post['name']),
				'mobile'=>trim($post['mobile']),
				'uniacid'=>$_SESSION['uniacid'],
				'username'=>'user_'.random(10),
				'from_os'=>get_os(),
				'is_virtual'=>1,
				'createtime'=>TIMESTAMP,
			);
			pdo_insert('core_members',$member);
			$mid=pdo_insertid();
			$data=array(
				'isdefault'=>1,
				'mobile'=>trim($post['mobile']),
				'name'=>trim($post['name']),
				'pcd'=>ijson_encode($post['pcd']),
				'address'=>trim($post['address']),
				'area_code'=>trim($post['area_code'])
			);
			$data['mid']=$mid;
			$data['uniacid']=$_SESSION['uniacid'];
			pdo_insert('core_address',$data);
			$addressid=pdo_insertid();
		}
		$address=array(
			'mobile'=>trim($post['mobile']),
			'name'=>trim($post['name']),
			'pcd'=>$post['pcd'],
			'address'=>trim($post['address']),
			'area_code'=>trim($post['area_code'])
		);
		$price=0;
		$goodslist=array();
		foreach($post['goods'] as &$gv){
			if(!$gv['goodsid']){
				exi('每个房间都要选择机子！','error');
			}
			$goods=pdo_get('jy_weishop_goods',array('id'=>$gv['goodsid'],'uniacid'=>$_SESSION['uniacid']));
			$gv['total']=1;
			$gv['price']=$goods['price'];
			$gv['plugin_name']='jy_kongtiaoshop';
			$goodslist[]=$gv;
			$price +=$goods['price'];
		}
		foreach($post['kongjian'] as &$gv){
			$goods=pdo_get('jy_weishop_goods',array('id'=>$gv['goodsid'],'uniacid'=>$_SESSION['uniacid']));
			$gv['total']=1;
			$gv['price']=$goods['price'];
			$gv['plugin_name']='jy_kongtiaoshop';
			$goodslist[]=$gv;
			$price +=$goods['price'];
		}
		if($post['waijiid']){
			$goods=pdo_get('jy_weishop_goods',array('id'=>$post['waijiid'],'uniacid'=>$_SESSION['uniacid']));
			$goodslist[]=array(
				'goodsid'=>$post['waijiid'],
				'total'=>1,
				'price'=>$goods['price'],
				'plugin_name'=>'jy_kongtiaoshop',
			);
		}
		$price +=$goods['price'];
		$post['peiinfo']['goods']=$post['goods'];
		$post['peiinfo']['kongjian']=$post['kongjian'];
		$post['peiinfo']['waijiid']=$post['waijiid'];
		$api_data=array(
			'peiinfo'=>$post['peiinfo'],
			'type'=>$post['type'],
			'storeid'=>$post['storeid'],
			'shequid'=>$post['shequid'],
			'homeid'=>$post['homeid'],
			'peilistid'=>$post['peilistid'],
			'hometypeid'=>$post['hometypeid'],
		);
		$api_data=array_merge($post['api_data'],$api_data);
		$new_order=array(
			'mid'=>$mid,
			'price'=>$price,
			'goodsprice'=>$price,
			'goods'=>$goodslist,
			'realname'=>$post['name'],
			'mobile'=>$post['mobile'],
			'address'=>$address,
			'is_peisong'=>1,
			'sendtype'=>1,
			'type'=>1,
			'storeid'=>$post['storeid'],
			'plugin_name'=>'jy_kongtiaoshop',
			'api_data'=>$api_data,
		);
		if($post['orderid']){
			foreach($goodslist as $k=>$gv){
				$order_goods=pdo_get('jy_weishop_order_goods',array('orderid'=>$post['orderid'],'goodsid'=>$gv['goodsid'],'uniacid'=>$_SESSION['uniacid']));
				if($order_goods['id']){
					unset($goodslist[$k]);
				}
			}
			$new_order['goods']=$goodslist;
			$new_order['oldorderid']=$post['orderid'];
			model('jy_weishop/order')->create($new_order);
			pdo_update('jy_weishop_order',array('api_data'=>ijson_encode($new_order['api_data'])),array('id'=>$post['orderid'],'uniacid'=>$_SESSION['uniacid']));
			unset($_SESSION['postdata']);
			exi('更新配置单成功！','','/order.list/');
		}else{
			model('jy_weishop/order')->create($new_order);
			unset($_SESSION['postdata']);
			exi('生成配置单成功！','','/order.list/');
		}
	}
	if($_RQ['id']){
		$order=pdo_get('jy_weishop_order',array('id'=>$_RQ['id'],'uniacid'=>$_SESSION['uniacid']));
		$api_data=json_decode($order['api_data'],true);
		$item=$api_data;
		$item['api_data']=$api_data;
		$item['mid']=$order['mid'];
		$item['orderid']=$order['id'];
		$address=json_decode($order['address'],true);
		unset($item['address']);
		$item=array_merge($address,$item);
	}else{
		if($_SESSION['postdata']['ishome']){
			$item=array(
				'type'=>$_SESSION['postdata']['type'],
				'storeid'=>$_SESSION['postdata']['storeid'],
				'shequtitle'=>$_SESSION['postdata']['shequtitle'],
				'ishome'=>$_SESSION['postdata']['ishome'],
				'hometypeid'=>$_SESSION['postdata']['hometypeid'],
			);
			$mianji=0;
			$goods=array();
			foreach($_SESSION['postdata']['houseinfo'] as $hv){
				$mianji +=$hv['mianji'];
				$goods[]=$hv;
			}
			foreach($_SESSION['postdata']['tinginfo'] as $tv){
				$mianji +=$tv['mianji'];
				$goods[]=$tv;
			}
			if(count($_SESSION['postdata']['houseinfo'])){
				$title=count($_SESSION['postdata']['houseinfo']).'房';
			}
			if(count($_SESSION['postdata']['tinginfo'])){
				$title .=count($_SESSION['postdata']['tinginfo']).'厅';
			}
			$item['home']=array(
				'title'=>$title,
				'mianji'=>$mianji,
			);
			$item['peiinfo']['goods']=$goods;
		}else{
			$item=pdo_get('jy_kongtiaoshop_peilist',array('id'=>$_SESSION['postdata']['peilistid'],'uniacid'=>$_SESSION['uniacid']));
			$item['home']=pdo_get('jy_kongtiaoshop_home',array('id'=>$item['homeid'],'uniacid'=>$_SESSION['uniacid']));
			$item['peiinfo']=json_decode($item['peiinfo'],true);
			$_SESSION['postdata']['groupid']=$item['groupid'];
		}
		$item['api_data']=array(
			'fangan'=>$item['title'],
			'hometypeid'=>$item['hometypeid'],
			'anfeedesc'=>'单管制A级管路安装法:采用中佳R410A专用管、华美环保级防火保温、ABS风口、追加杜邦冷媒、充氮焊接',
			'anfee'=>1500,
		);
	}
	$item['peiinfo']=$this->model('model')->uppeiinfo($item['peiinfo']);
	$item['goods']=$item['peiinfo']['goods'];
	foreach($item['goods'] as &$gv){
			$goods=pdo_get('jy_weishop_goods',array('id'=>$gv['goodsid'],'uniacid'=>$_SESSION['uniacid']));
			$gv['total']=1;
			$gv['price']=$goods['price'];
			$gv['api_data']=json_decode($goods['api_data'],true);
	}
	$item['kongjian']=$item['peiinfo']['kongjian'];
	$item['waijiid']=$item['peiinfo']['waijiid'];
	$return['item']=$item;
	$htmls=array(
		'type'=>'edit',
		'desc'=>$item['orderid']?'更新配置单':'生成配置单',
		'show_last'=>true,
		'edit'=>array(
			array('name'=>'home.title','title'=>'户型名称','type'=>'copy'),
			array('name'=>'hometypeid','title'=>'建筑类型','type'=>'select','options'=>'hometypes','read'=>true),
			array('name'=>'home.mianji','title'=>'房间总面积','type'=>'copy'),
			array('name'=>'type','title'=>'方案类型','type'=>'radio','options'=>'types','read'=>true),
			array('name'=>'api_data.fangan','title'=>'方案名称','type'=>'copy'),
			array('name'=>'api_data.xmtitle','title'=>'项目名称','type'=>'string'),
			array('name'=>'api_data.huxing','title'=>'户型','type'=>'string'),
			//array('name'=>'api_data.lounum','title'=>'楼高','type'=>'copy'),
			//array('name'=>'api_data.pinpai','title'=>'空调品牌','type'=>'copy'),
			array('name'=>'api_data.peibi','title'=>'配比','type'=>'unitstring','unit'=>'倍'),
			array('name'=>'api_data.onewfee','title'=>'设计负荷','type'=>'unitstring','unit'=>'W/m²'),
		)
	);
	$htmls['edit'][]=array('title'=>'配单信息','type'=>'title');
	if(!$item['type']){
		$htmls['edit'][]=array(
			'type'=>'array',
			'noadd'=>1,
			'nodel'=>1,
			'name'=>'goods',
			'title'=>'中央内机',
			'list'=>array(
				array('type'=>'string','name'=>'title','title'=>'房间名称'),
				array('name'=>'mianji','title'=>'房间面积','type'=>'unitstring','unit'=>'m²'),
				array('type'=>'select','name'=>'goodsid','title'=>'内机','options'=>'goods1'),
				array('name'=>'api_data.wfee','title'=>'制冷量(W)','type'=>'unitstring','unit'=>'W','help'=>'例如：2800'),
				array('name'=>'api_data.onewfee','title'=>'制冷负荷(W/m²)','type'=>'unitstring','unit'=>'W/m²','help'=>'例如：152'),
				array('name'=>'api_data.wfee2','title'=>'制热量(W)','type'=>'unitstring','unit'=>'W','help'=>'例如：3200'),
				array('name'=>'api_data.onewfee2','title'=>'制热负荷(W/m²)','type'=>'unitstring','unit'=>'W/m²','help'=>'例如：195'),
			),
			'details'=>array(
				array('type'=>'string','name'=>'title','title'=>'房间名称','read'=>true),
				array('name'=>'mianji','title'=>'房间面积','type'=>'unitstring','unit'=>'m²','read'=>true),	
				array('type'=>'select_item','name'=>'goodsid','title'=>'内机','options'=>'goods1','itemkey'=>'api_data'),		
			)
		);
	}
	if($item['type']==1){
		$htmls['edit'][]=array(
			'type'=>'array',
			'noadd'=>1,
			'nodel'=>1,
			'name'=>'goods',
			'title'=>'普通空调',
			'list'=>array(
				array('type'=>'string','name'=>'title','title'=>'房间名称'),
				array('name'=>'mianji','title'=>'房间面积','type'=>'unitstring','unit'=>'m²'),
				array('type'=>'select','name'=>'goodsid','title'=>'空调','options'=>'goods0'),
				array('name'=>'api_data.wfee','title'=>'制冷量(W)','type'=>'unitstring','unit'=>'W','help'=>'例如：2800'),
				array('name'=>'api_data.onewfee','title'=>'制冷负荷(W/m²)','type'=>'unitstring','unit'=>'W/m²','help'=>'例如：152'),
				array('name'=>'api_data.wfee2','title'=>'制热量(W)','type'=>'unitstring','unit'=>'W','help'=>'例如：3200'),
				array('name'=>'api_data.onewfee2','title'=>'制热负荷(W/m²)','type'=>'unitstring','unit'=>'W/m²','help'=>'例如：195'),
			),
			'details'=>array(
				array('type'=>'string','name'=>'title','title'=>'房间名称','read'=>true),
				array('name'=>'mianji','title'=>'房间面积','type'=>'unitstring','unit'=>'m²','read'=>true),	
				array('type'=>'select_item','name'=>'goodsid','title'=>'空调','options'=>'goods0','itemkey'=>'api_data'),		
			)
		);
	}
	$htmls['edit'][]=array('type'=>'select','name'=>'waijiid','title'=>'中央外机'.$item['wfee'].'W','options'=>'goods3','show'=>array('type'=>'0'));
	$htmls['edit'][]=array(
		'type'=>'array',
		'show'=>array('type'=>'0'),
		'name'=>'kongjian',
		'title'=>'线控器',
		'add_tip'=>'添加一种线控器',
		'list'=>array(
			array('type'=>'select','name'=>'goodsid','title'=>'选择线控器','options'=>'goods2'),
			array('name'=>'num','title'=>'数量','type'=>'unitstring','unit'=>'个'),			
		),
		'details'=>array(
			array('type'=>'select','name'=>'goodsid','title'=>'选择线控器','options'=>'goods2'),
			array('name'=>'num','title'=>'数量','type'=>'unitstring','unit'=>'个'),	
		)
	);
	$htmls['edit'][]=array('name'=>'api_data.anfeedesc','title'=>'安装服务费说明','type'=>'string');
	$htmls['edit'][]=array('name'=>'api_data.anfee','title'=>'安装服务费','type'=>'unitstring','unit'=>'元');
	$htmls['edit'][]=array('name'=>'api_data.addpeidesc','title'=>'增加配置项说明','type'=>'string');
	$htmls['edit'][]=array('name'=>'api_data.addpeifee','title'=>'增加配置项费用','type'=>'unitstring','unit'=>'元');
	$htmls['edit'][]=array('title'=>'客户信息','type'=>'title');
	$htmls['edit'][]=array('type'=>'choose','title'=>'选择会员','name'=>'mid','action'=>'core/member.get_member/','choose_title'=>'选择会员','help'=>'选择客户');
	$htmls['edit'][]=array('name'=>'name','title'=>'客户姓名','type'=>'string');
	$htmls['edit'][]=array('name'=>'mobile','title'=>'客户电话','type'=>'string');
	$htmls['edit'][]=array('name'=>'pcd','title'=>'客户区域地址','type'=>'pcd');
	$htmls['edit'][]=array('name'=>'address','title'=>'客户详细地址','type'=>'string');
	$return['types']=array('中央空调','普通家用空调');
	if(!$item['orderid']){
		$return['htmls'][]=array('type'=>'steps','steps'=>$steps,'step'=>'3');
	}else{
		$htmls['show_last']=false;
	}
	$return['htmls'][]=array(
		'type'=>'message',
		'message'=>'温馨提示：带“*”的为必填项！',
	);
	$return['htmls'][]=$htmls;
	$return['goods1']=pdo_getall('jy_weishop_goods',array('pcate'=>$_SESSION['postdata']['groupid'],'uniacid'=>$_SESSION['uniacid'],'onepluginname'=>'jy_kongtiaoshop','type <>'=>4,'nochecked'=>0,'no_showsys'=>0,'no_onebuy'=>1),array('id','title','price','api_data'),'id');
	foreach($return['goods1'] as &$gv1){
		$gv1['api_data']=json_decode($gv1['api_data'],true);
		$gv1['itemkey']=array(
			'wfee'=>$gv1['api_data']['wfee'],
			'onewfee'=>$gv1['api_data']['onewfee'],
			'wfee2'=>$gv1['api_data']['wfee2'],
			'onewfee2'=>$gv1['api_data']['onewfee2'],
		);
		$gv1['title']=$gv1['title'].'('.$gv1['api_data']['sn'].')'.'('.$gv1['api_data']['wfee'].'W)'.'(￥'.$gv1['price'].')';
	}
	$return['goods0']=pdo_getall('jy_weishop_goods',array('pcate'=>$_SESSION['postdata']['groupid'],'uniacid'=>$_SESSION['uniacid'],'onepluginname'=>'jy_kongtiaoshop','type <>'=>4,'nochecked'=>0,'no_showsys'=>0,'no_onebuy'=>0),array('id','title','price','api_data'),'id');
	foreach($return['goods0'] as &$gv1){
		$gv1['api_data']=json_decode($gv1['api_data'],true);
		$gv1['itemkey']=array(
			'wfee'=>$gv1['api_data']['wfee'],
			'onewfee'=>$gv1['api_data']['onewfee'],
			'wfee2'=>$gv1['api_data']['wfee2'],
			'onewfee2'=>$gv1['api_data']['onewfee2'],
		);
		$gv1['title']=$gv1['title'].'('.$gv1['api_data']['sn'].')'.'('.$gv1['api_data']['wfee'].'W)'.'(￥'.$gv1['price'].')';
	}
	$return['goods2']=pdo_getall('jy_weishop_goods',array('pcate'=>$_SESSION['postdata']['groupid'],'uniacid'=>$_SESSION['uniacid'],'onepluginname'=>'jy_kongtiaoshop','type <>'=>4,'nochecked'=>0,'no_showsys'=>0,'no_onebuy'=>2),array('id','title','price','api_data'),'id');
	foreach($return['goods2'] as &$gv1){
		$gv1['api_data']=json_decode($gv1['api_data'],true);
		$gv1['itemkey']=array(
			'wfee'=>$gv1['api_data']['wfee'],
			'onewfee'=>$gv1['api_data']['onewfee'],
			'wfee2'=>$gv1['api_data']['wfee2'],
			'onewfee2'=>$gv1['api_data']['onewfee2'],
		);
		$gv1['title']=$gv1['title'].'('.$gv1['api_data']['sn'].')'.'(￥'.$gv1['price'].')';
	}
	$return['goods3']=pdo_getall('jy_weishop_goods',array('pcate'=>$_SESSION['postdata']['groupid'],'uniacid'=>$_SESSION['uniacid'],'onepluginname'=>'jy_kongtiaoshop','type <>'=>4,'nochecked'=>0,'no_showsys'=>0,'no_onebuy'=>3),array('id','title','price','api_data'),'id');
	foreach($return['goods3'] as &$gv1){
		$gv1['api_data']=json_decode($gv1['api_data'],true);
		$gv1['itemkey']=array(
			'wfee'=>$gv1['api_data']['wfee'],
			'onewfee'=>$gv1['api_data']['onewfee'],
			'wfee2'=>$gv1['api_data']['wfee2'],
			'onewfee2'=>$gv1['api_data']['onewfee2'],
		);
		$gv1['title']=$gv1['title'].'('.$gv1['api_data']['sn'].')'.'('.$gv1['api_data']['wfee'].'W)'.'(￥'.$gv1['price'].')';
	}
	$return['hometypes']=pdo_getall('jy_kongtiaoshop_home_type',array('uniacid'=>$_SESSION['uniacid']),array('id','title'),'id');
	exi($return);
}
?>